package leetcode.problems;

import com.tools.LeetCodeTools;

/**
 * Created by cl_kd-user47823 on 2021/7/9.
 */
public class MaxProfix {
    public static void main(String[] args) {
        int[] arr= LeetCodeTools.getIntArr(10,10);
        LeetCodeTools.printIntArr(arr);
        getMaxProfix(arr);
    }
    public static int getMaxProfix(int[] arr){
        int profixAncount=0;
        int profixNow=0;
        int maxPrice=0;
        for(int i=0;i<arr.length;i++){
            if((i+1)<arr.length){
                if(profixNow==0){//是否空仓
                    if(maxPrice<arr[i]&&arr[i]<arr[i+1]){//第二天价格大于当天则购买
                        maxPrice=arr[i];
                    }
                }else{
                    if(arr[i]>arr[i+1]){//第二天价格低


                    }
                }

            }else{

            }
        }
        return profixAncount;
    }

}